package ch11;

import java.util.Set;
import java.util.TreeSet;

class _13_TreeSetLotto {
	public static void main(String[] args) {
		Set<Integer> set = new TreeSet<Integer>();

		while(set.size() < 6) 
			set.add((int) (Math.random() * 45) + 1);

		System.out.println(set); // [4, 24, 29, 30, 31, 34]
	}
}